import axios from "axios";
import { ArticleDetail } from "@/types/article";

const API_BASE = "/api/articles/";

/** 根据slug获取文章详情 */
export const getArticleBySlug = async (slug: string): Promise<ArticleDetail> => {
  const res = await axios.get(`${API_BASE}${slug}/`);
  return res.data;
};